using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

namespace HadronData
{
    [ContentTypeWriter]
    public class LayerContentTypeWriter : ContentTypeWriter<Layer>
    {
        protected override void Write(ContentWriter p_contentWriter, Layer p_layer)
        {
            p_contentWriter.Write(p_layer.Name);
            p_contentWriter.Write(p_layer.Position);
            p_contentWriter.Write(p_layer.Orientation);
            p_contentWriter.Write(p_layer.AngularSpeed);
            p_contentWriter.WriteObject<List<Edge>>(p_layer.Edges);
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(LayerContentTypeReader).AssemblyQualifiedName;
        }
    }
}
